1. Field of the Invention
The present invention relates to a controller area network (CAN) communication device improved in efficiency.
2. Description of the Related Art
In the field oft for example, automobiles, which is amid technological trends toward increase in modularized devices, intelligent devices, and devices with reduced harnesses, industries have started rapidly employing device controls using serial communication schemes represented by, for example, a controller area network (CAN) communication scheme.
In particular, in the field of automobiles, a device connected via communication lines and thereby controlled is substantially fixed at a development stage, and no case occurs in which the device connection is changed at least during the stages of production and postproduction.
Thus, in the serial communication represented by the CAN communication mounted on an automobile, IDs individually indicating, for example, device identifications, priorities of communication data, the contents of communication data, are arbitrarily coded and determined in a design stage.
FIG. 9 shows examples of function IDs of, for example, a desired steering angle, which are assigned using 16 bits of 29-bit ID fields according to CAN 2.0B specifications. An ID field other than the 16-bit ID field is allocated to a node ID (ID that physically identifies the node).
However, according to the method of arbitrary assigning codes of IDs as shown in FIG. 9, although a sufficient number of free codes were available in an initial development stage, suitable free codes are running short during advancement of developments.
“Priorities (of data communication)” are semantically defined for many protocol IDs, such as CAN-IDs. Thus, probability is high in that a suitable free ID is already unavailable while assignment of a code of a high-priority ID is desired in a latter stage of development.
Another incidence can also occur. Suppose when serial codes are already assigned to ID(A1) to ID(A3), assignment of a code of ID(A2) having a priority semantically higher than that of a code of ID(A3) and semantically lower than that of a code of ID(A1) is attempted. Even in this case, since no free codes exist between ID(A1) and ID(A3), a desired code corresponding to the priority cannot be assigned to ID(A2).
In addition, according to the scheme of coding an ID for each physical unit, a new ID must be assigned when a physical unit is developed in future by integration or disintegration of functions of the physical unit of the current version. Thus, if a desired ID corresponding to the priority is not preserved free, the code assignment would fail.
In the example shown in FIG. 9, shift remote control is coded “H′3000”, and throttle remote control is coded “H′4000”. Suppose the shift remote control and the throttle remote control are integrated, and a shift+throttle remote control is thus created as a new function. In this case, the new shift+throttle remote control can be coded “H′2500” representing a priority higher than the priorities of the shift remote control and the throttle remote control. Further, suppose a steering remote control function is integrated into the aforementioned function, and a shift+throttle+steering remote control is thus created as a new function. In this case, the shift remote control and the throttle remote control can be coded “H′500” representing a priority higher than the priority of the steering remote control.
However, it is obvious that the coding system would fail when functions are thus repeatedly added.
As described above, according to the CAN specifications, the CAN-ID semantically represents the communication priority. Concurrently, the CAN-ID semantically represents a data identifier in application. Thus, once an ID has been assigned, it is difficult to change the priority in order to maintain data compatible with another system. For example, while “H′3000” is assigned to an ID for a shift remote control, “‘H’3000” is assigned as well to an ID for a shift remote control in a different system. Thus, ID specifications must be changed in all the relevant systems to change the priority.
In addition, in a network already in operation, a case can occur in which consecutive arbitration losses are caused while communication is carried out using a specific ID, establishing no proper communication. Although this is avoidable with respect to a design, this leads to a problem, particularly, in the field of shipbuilding. An engine manufacturer in this field delivers only engines, not finished ships; therefore, a boat-builder or a user, rather than the engine manufacturer, has choices for the system configuration. This makes it difficult for the engine manufacturer to control the system configuration.
FIG. 10 is a flowchart of data transmission in a conventional CAN communication device. In the flowchart, when a case occurs, in which data is to be transmitted at a time interval of 10 (msec), the data is transmitted through a routine that is started with step S101 at a periodic interval of 10 (msec).
First, at step S102, the routine determines as to whether previously transmitted data is in a transmission retry performed as a CAN chip function. Next, if the data is not in the retry, the data of the present instance is transmitted at step S103. If the data is in the retry, the routine executes nothing but terminates at step S104. Thereafter, a routine similar to the 10(msec)-regular-interval routine is iterated. If the retry continues in the routine, this data is not transmitted forever.
Thus, the control of the system configuration is difficult for an engine manufacturer, particularly, in the field of shipbuilding. This also makes it difficult for the manufacturer to estimate the total amount of traffic (communication amount). Thus, depending on the system configuration, a traffic overflow may occur, resulting in causing communication failure.
Next, FIG. 11 is a flowchart of conventional gateway transfer operation. Referring to FIG. 11, the gateway transfer operation starts with step S111 in which a gateway node receives data via a CAN 1ch Bus.
At step S112, the received data is filtered through a hardware function provided in a CAN chip, and is then stored in a buffer provided in the CAN chip. In many CAN chips, the number of types of filtering functions provided in the form of hardware is only three at maximum. Thus, filtering for all the IDs cannot be implemented using hardware.
At step S113, a function group ID is either “H′3000” or “H′4000”, the received data is transmitted via a CAN 2ch Bus at step S114. However, at step S113, if the function group ID is neither “H′3000” nor “H′4000”, the received data is discarded at step S115.
Finally, at step S116, the series of the gateway transfer operation steps terminates.
Thus, the limitation is imposed on use of the hardware filtering functions of the CAN chip. This arises a problem when a large number of IDs are to be transmitted. Specifically, since all the large number of IDs must be checked, the software load is extremely increased.